package dto

import (
	"time"
	"vrcm/src/vrcm/app/admin/models/live"
	"vrcm/src/vrcm/common/dto"
	common "vrcm/src/vrcm/common/models"
)

type LiveBasicGetPageReq struct {
	dto.Pagination `search:"-"`
	TenantId       string `json:"tenant_id"  search:"type:exact;column:tenant_id;table:live_basic"`
	Scene          int    `json:"scene"  search:"type:exact;column:scene;table:live_basic"`
	LiveState      int    `json:"live_state"  search:"type:exact;column:live_state;table:live_basic"`
	LiveType       int    `json:"live_type"  search:"type:exact;column:live_type;table:live_basic"`
	OrderFiled     int    `json:"order_filed" search:"" comment:"排序1.创建时间 2直播时间"`
	IsDelete       int    `json:"is_delete"  search:"type:exact;column:is_delete;table:live_basic"`
	CorpId         string `json:"corp_id"  search:"type:exact;column:corp_id_secret;table:live_basic"`
}

type LiveBasicOrder struct {
	Id         string `form:"idOrder"  search:"type:order;column:id;table:live_basic"`
	LiveName   string `form:"live_nameOrder"  search:"type:order;column:live_name;table:live_basic"`
	TenantId   string `form:"tenant_idOrder"  search:"type:order;column:tenant_id;table:live_basic"`
	Scene      string `form:"sceneOrder"  search:"type:order;column:scene;table:live_basic"`
	LiveId     string `form:"live_idOrder"  search:"type:order;column:live_id;table:live_basic"`
	LiveMode   string `form:"live_modeOrder"  search:"type:order;column:live_mode;table:live_basic"`
	Delay      string `form:"delayOrder"  search:"type:order;column:delay;table:live_basic"`
	LiveTime   string `form:"live_timeOrder"  search:"type:order;column:live_time;table:live_basic"`
	LiveState  string `form:"live_stateOrder"  search:"type:order;column:live_state;table:live_basic"`
	Notice     string `form:"noticeOrder"  search:"type:order;column:notice;table:live_basic"`
	LogUrl     string `form:"log_urlOrder"  search:"type:order;column:log_url;table:live_basic"`
	Desc       string `form:"descOrder"  search:"type:order;column:desc;table:live_basic"`
	IsDelete   string `form:"is_deleteOrder"  search:"type:order;column:is_delete;table:live_basic"`
	CreateBy   string `form:"createByOrder"  search:"type:order;column:create_by;table:live_basic"`
	UpdateBy   string `form:"updateByOrder"  search:"type:order;column:update_by;table:live_basic"`
	CreateTime string `form:"create_timeOrder"  search:"type:order;column:create_time;table:live_basic"`
	UpdateTime string `form:"update_timeOrder"  search:"type:order;column:update_time;table:live_basic"`
}

func (m *LiveBasicGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type LiveBasicInsertReq struct {
	Id         int            `json:"-" comment:""` //
	LiveName   string         `json:"live_name" comment:"直播名称" validate:"required,max=100"`
	TenantId   string         `json:"tenant_id" comment:"租户" "`
	GroupId    string         `json:"group_id" comment:"群组id"`
	Scene      int            `json:"scene" comment:"直播场景 1标准直播 2互动直播 3多视角直播"`
	RoomType   int            `json:"room_type" comment:"直播场景 1快直播 2慢直播"`
	LiveMode   int            `json:"live_mode" comment:"直播方式 1超低延迟、2低延迟、3常规延迟"`
	LiveSource int            `json:"live_source" comment:"直播来源 1素材文件 2直播信号"`
	Delay      int            `json:"delay" comment:"直播延迟 默认0s"`
	LiveTime   int64          `json:"live_time" comment:"直播时间"`
	LiveState  int            `json:"live_state" comment:"直播间状态  1.预告 2直播中 3暂停直播 4已结束"`
	Notice     string         `json:"notice" comment:"公告"`
	LogUrl     string         `json:"log_url" comment:"直播封面图片地址"`
	Desc       string         `json:"desc" comment:"简介"`
	ExpireTime int64          `json:"expire_time" comment:"直播流地址过期时间"`
	ViewNames  []string       `json:"view_names" comment:"视角名称"`
	LiveType   int            `json:"live_type" comment:"类型 1直播 2点播"`
	VideoUrl   string         `json:"video_url" comment:"视频地址"`
	BindId     string         `json:"bind_id" comment:"文件id"`
	VideoInfo  string         `json:"video_info" comment:"文件信息"`
	CountDown  int            `json:"count_down" comment:"是否倒计时 1是 2否"`
	ChatType   string         `json:"chat_type" comment:"im comment"`
	CreateIM   IMCreateReqDto `json:"create_im" comment:"聊天室参数"`
	common.ControlBy
}

type LiveVodInsertReq struct {
	Id       int    `json:"-" comment:""` //
	LiveName string `json:"live_name" comment:"直播名称" validate:"required,max=100"`
	TenantId string `json:"tenant_id" comment:"租户" validate:"required"`
	LogUrl   string `json:"log_url" comment:"直播封面图片地址" validate:"max=300"`
	Desc     string `json:"desc" comment:"简介" validate:"max=500"`
	LiveType int    `json:"live_type" comment:"类型 1直播 2点播"`
	VideoUrl string `json:"video_url" comment:"视频地址"`
	BindId   string `json:"bind_id" comment:"文件id"`
	common.ControlBy
}

type View struct {
	ViewName string `json:"view_name" comment:"视角名称"`
	ViewNo   int    `json:"view_no" comment:"视角号"`
	Id       int    `json:"id" comment:"id"`
}

type MoveViewReq struct {
	Id      int `json:"id" comment:"" validate:"required"` //
	BasicId int `json:"basic_id" comment:"基本信息id" validate:"required"`
	Type    int `json:"type" comment:"移动类型 1 上移 2下移"  validate:"required,gt=0"`
}

type LiveBasicReq struct {
	Id       int    `json:"id" comment:""` //
	LiveName string `json:"live_name" comment:"直播名称" validate:"required,max=100"`
	TenantId string `json:"tenant_id" comment:"租户" validate:"required"`
	IsDelete int    `json:"is_delete" comment:"是否删除 1删除 2未删除" validate:"required"`
}

func (s *LiveBasicInsertReq) Generate(model *live.LiveBasic) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	now := time.Now().Unix()
	model.LiveName = s.LiveName
	model.TenantId = s.TenantId
	model.Scene = s.Scene
	model.LiveMode = s.LiveMode
	model.Delay = s.Delay
	model.LiveTime = s.LiveTime
	model.LiveState = 1
	model.Notice = s.Notice
	model.LogUrl = s.LogUrl
	model.Desc = s.Desc
	model.IsDelete = 2
	model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
	model.CreateTime = now
	model.UpdateTime = now
	model.GroupId = s.GroupId
	model.Multiple = 1
	model.IsConfirm = 2
	model.LiveSource = s.LiveSource
	model.RoomType = s.RoomType
	if s.RoomType == 0 {
		model.RoomType = 1
	}
	model.LiveType = s.LiveType
	model.VideoUrl = s.VideoUrl
	model.BindId = s.BindId
	if s.CountDown == 0 {
		s.CountDown = 2
	}
	//model.CountDown = s.CountDown
}

func (s *LiveBasicInsertReq) GetId() interface{} {
	return s.Id
}

type LiveBasicUpdateReq struct {
	Id         int    `json:"id" comment:""  validate:"required"` //
	LiveName   string `json:"live_name" comment:"直播名称" validate:"required,max=100"`
	TenantId   string `json:"tenant_id" comment:"租户"`
	GroupId    string `json:"group_id" comment:"群组id"`
	Scene      int    `json:"scene" comment:"直播场景 1通用 2慢直播"`
	RoomType   int    `json:"room_type" comment:"直播场景 1快直播 2慢直播"`
	LiveId     string `json:"live_id" comment:"直播id"`
	LiveMode   int    `json:"live_mode" comment:"直播方式 1纯视频"`
	LiveSource int    `json:"live_source" comment:"直播来源 1素材文件 2直播信号"`
	Delay      int    `json:"delay" comment:"直播延迟 默认0s" validate:"gte=0"`
	LiveTime   int64  `json:"live_time" comment:"直播时间" validate:"required,gt=0"`
	//LiveState  int            `json:"live_state" comment:"直播间状态 1.预告 2直播中 3暂停直播 4已结束"`
	Notice    string         `json:"notice" comment:"公告" validate:"max=500"`
	LogUrl    string         `json:"log_url" comment:"直播封面图片地址"`
	Desc      string         `json:"desc" comment:"简介"`
	CreateIM  IMCreateReqDto `json:"create_im" comment:"聊天室参数"`
	Views     []View         `json:"views" comment:"视角信息"`
	CountDown int            `json:"count_down" comment:"是否倒计时 1是 2否"`
	RecordId  string         `json:"record_id" comment:"录制文件id"`
	common.ControlBy
}

type SaveCorpIdReq struct {
	Id       int    `json:"id" comment:""  validate:"required"` //
	CorpIds  string `json:"corp_ids" comment:"企业id" `
	AgentIds string `json:"agent_ids" comment:"企业id" `
	common.ControlBy
}

func (s *LiveBasicUpdateReq) Generate(model *live.LiveBasic) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LiveName = s.LiveName
	model.TenantId = s.TenantId
	model.Scene = s.Scene
	model.LiveMode = s.LiveMode
	model.Delay = s.Delay
	model.LiveTime = s.LiveTime
	//model.LiveState = s.LiveState
	model.Notice = s.Notice
	model.LogUrl = s.LogUrl
	model.Desc = s.Desc
	model.IsDelete = 2
	model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
	model.UpdateTime = time.Now().Unix()
	model.LiveSource = s.LiveSource
	model.RoomType = s.RoomType
	if s.RoomType == 0 {
		model.RoomType = 1
	}
	//model.CountDown = s.CountDown
}

func (s *LiveBasicUpdateReq) GetId() interface{} {
	return s.Id
}

// LiveBasicGetReq 功能获取请求参数
type LiveBasicGetReq struct {
	Id       int    `uri:"id"`
	TenantId string `json:"tenant_id" comment:"租户"`
}

func (s *LiveBasicGetReq) GetId() interface{} {
	return s.Id
}

// LiveBasicDeleteReq 功能删除请求参数
type LiveBasicDeleteReq struct {
	Id       int    `json:"id"`
	BindId   string `json:"bind_id"`
	TenantId string `json:"tenant_id" comment:"租户"`
}

func (s *LiveBasicDeleteReq) GetId() interface{} {
	return s.Id
}

type LiveStreamInsertReq struct {
	TenantId              string `json:"tenant_id" comment:"租户" validate:"required"`
	BasicId               int    `json:"basic_id" comment:"基本信息id" validate:"required"`
	EventName             string `json:"event_name" comment:"直播名称" validate:"required"`
	EventType             string `json:"event_type" comment:"直播类型。1 - 推流至平台，2 - 拉流至平台" validate:"required"`
	ExpireTime            int64  `json:"expire_time" comment:"过期时间"`
	AppName               string `json:"app_name" comment:"应用名" validate:"required"`
	ServiceArea           string `json:"service_area" comment:"服务区域。cn_mainland - 中国大陆，global - 全球" validate:"required"`
	AutoRecord            string `json:"auto_record" comment:"是否自动录制。1 - 自动录制，0 - 不自动录制" validate:"required"`
	PullOrPush            string `json:"pull_or_push" comment:"直播状态回调地址（第三方通知地址）"`
	WebPusherEnable       int    `json:"web_pusher_enable" comment:"是否开启web推流" validate:"gte=0"`
	IMEnable              int    `json:"imEnable" comment:"1 - 开启IM，0 - 禁用IM" validate:"gte=0"`
	Expiry                string `json:"expiry" comment:"过期时间。单位：秒" validate:"required"`
	PullStreamAddress     string `json:"pull_stream_address" comment:"拉流地址"`
	RecordFileCallbackUrl string `json:"record_file_callback_url" comment:"拉流地址"`
	Tag                   string `json:"tag" comment:"标签"`

	common.ControlBy
}

type UpdateLiveStreamExpireTimeReq struct {
	TenantId   string `json:"tenant_id" comment:"租户"`
	BasicId    int    `json:"basic_id" comment:"基本信息id" validate:"required"`
	LiveId     string `json:"live_id" comment:"直播间id" validate:"required"`
	ExpireTime int64  `json:"expire_time" comment:"过期时间"`
	Expiry     string `json:"expiry" comment:"过期时间。单位：秒" validate:"required"`
	common.ControlBy
}

type LiveStreamInsertRes struct {
	TenantId        string `json:"tenant_id" comment:"租户"`
	EventName       string `json:"event_name" comment:"直播名称" validate:"required"`
	EventType       string `json:"event_type" comment:"直播类型。1 - 推流至平台，2 - 拉流至平台" validate:"required"`
	ExpireTime      int    `json:"expire_time" comment:"过期时间。单位：秒" validate:"required"`
	AppName         string `json:"app_name" comment:"应用名" validate:"required"`
	ServiceArea     string `json:"service_area" comment:"服务区域。cn_mainland - 中国大陆，global - 全球" validate:"required"`
	AutoRecord      string `json:"auto_record" comment:"是否自动录制。1 - 自动录制，0 - 不自动录制" validate:"required"`
	PullOrPush      string `json:"pull_or_push" comment:"直播状态回调地址（第三方通知地址）" validate:"required"`
	SpacerInfo      string `json:"spacer_info" comment:"垫片源"`
	WebPusherEnable int    `json:"web_pusher_enable" comment:"是否开启web推流" validate:"gte=0"`
	IMEnable        int    `json:"imEnable" comment:"1 - 开启IM，0 - 禁用IM" validate:"gte=0"`
}

type LiveMonitorRecordInsertReq struct {
	Id          int    `json:"-" comment:""` //
	TenantId    string `json:"tenant_id" comment:"租户id"`
	BasicId     int    `json:"basic_id" comment:"基本信息id"`
	LiveId      string `json:"live_id" comment:"直播id"`
	FlvUrl      string `json:"flv_url" comment:"flv拉流地址"`
	HlsUrl      string `json:"hls_url" comment:"hls拉流地址"`
	RtmpUrl     string `json:"rtmp_url" comment:"rtmp拉流地址"`
	PreviewUrl  string `json:"preview_url" comment:"预览地址"`
	WebrtcUrl   string `json:"webrtc_url" comment:"webrtc拉流地址"`
	ViewUrl     string `json:"view_url" comment:"观看地址"`
	MobileUrl   string `json:"mobile_url" comment:"移动端观看二维码"`
	PushUrl     string `json:"push_url" comment:"推流地址"`
	ExpireTime  int64  `json:"expire_time" comment:"失效时间"`
	RoomAddress string `json:"room_address" comment:"房间地址"`
	RoomNo      string `json:"room_no" comment:"房间号"`
	common.ControlBy
}

func (s *LiveMonitorRecordInsertReq) Generate(model *live.LiveMonitorRecord) {
	now := time.Now().Unix()
	model.TenantId = s.TenantId
	model.BasicId = s.BasicId
	model.LiveId = s.LiveId
	model.FlvUrl = s.FlvUrl
	model.HlsUrl = s.HlsUrl
	model.RtmpUrl = s.RtmpUrl
	model.ViewUrl = s.ViewUrl
	model.MobileUrl = s.MobileUrl
	model.PushUrl = s.PushUrl
	model.PreviewUrl = s.PreviewUrl
	model.WebrtcUrl = s.WebrtcUrl
	model.ExpireTime = s.ExpireTime
	model.IsDelete = 2
	model.RoomNo = s.RoomNo
	model.RoomAddress = s.RoomAddress
	model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
	model.CreateTime = now
	model.UpdateTime = now
}

type StartOrEndLiveReq struct {
	TenantId          string `json:"tenant_id" comment:"租户id"`
	BasicId           int    `json:"basic_id" comment:"基本信息id"  validate:"required"`
	LiveType          int    `json:"live_type" comment:"直播类型 1.预告 3.暂停 4.结束" validate:"gt=0"`
	PullStreamAddress string `json:"pull_stream_address" comment:"拉流地址"`
	LiveId            int    `json:"live_id"`
}

type PublishVodLiveReq struct {
	BasicId      int `json:"basic_id" comment:"基本信息id"  validate:"required"`
	PublishState int `json:"publish_state" comment:"发布状态 1 发布 2未发布" `
}

type DeleteLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id" `
	LiveId   string `json:"live_id" comment:"直播流id"  validate:"required"`
}

type StopLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id" `
	LiveId   string `json:"live_id" comment:"直播流id"`
}

type StopLiveTaskReq struct {
	Id int `json:"id" comment:"id" `
}

type GetTokenReq struct {
	TenantId string `json:"tenant_id" comment:"租户id" `
}

type IMCreateReqDto struct {
	Name            string `json:"name" comment:"群名" `
	TenantId        string `json:"tenant_id" comment:"租户id"`
	GroupId         string `json:"group_id" comment:"群组id"`
	RoomType        string `json:"room_type" comment:"群组id"`
	Notification    string `json:"notification" comment:"群公告"`
	ApplyJoinOption string `json:"apply_join_option" comment:"申请加群处理方式。包含 FreeAccess（自由加入），NeedPermission（需要验证），DisableApply（禁止加群），不填默认为 NeedPermission（需要验证） 仅当创建支持申请加群的群组时，该字段有效"`
}

type UpdateBasicInfoReq struct {
	Id            int    `json:"id" comment:""  validate:"required"` //
	TenantId      string `json:"tenant_id" comment:"租户id"`
	LiveName      string `json:"live_name" comment:"直播名称" validate:"required,max=100"`
	VideoListName string `json:"video_list_name" comment:"视频列表名称" validate:"max=20"`
	Desc          string `json:"desc" comment:"简介" validate:"max=500"`
	common.ControlBy
}

type UpdateGuidePageReq struct {
	Id        int    `json:"id" comment:""` //
	TenantId  string `json:"tenant_id" comment:"租户id"`
	LiveId    int    `json:"live_id" comment:"直播间id" validate:"required"`
	LiveName  string `json:"live_name" comment:"直播名称" `
	GuideFace string `json:"guide_face" comment:"引导页封面" `
	GuideBack string `json:"guide_back" comment:"引导页背景图" `
	GuideLogo string `json:"guide_logo" comment:"引导页背logo"`
	IsEnable  int    `json:"is_enable" comment:"是否开启 1是 2 否"`
	common.ControlBy
}

type UpdateVirtualNumReq struct {
	Id       int    `json:"id" comment:""` //
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   int    `json:"live_id" comment:"直播间id" validate:"required"`
	BasicNum int    `json:"basic_num" comment:"基础人数" validate:"gte=0"`
	Multiple int    `json:"multiple" int;comment:"倍数" validate:"gt=0"`
	IsEnable int    `json:"is_enable" comment:"是否开启 1是 2 否" validate:"gt=0"`
	common.ControlBy
}

type UpdateIMReq struct {
	Id       int            `json:"id" comment:""` //
	TenantId string         `json:"tenant_id" comment:"租户id" `
	LiveId   int            `json:"live_id" comment:"直播间id" validate:"required"`
	IsEnable int            `json:"is_enable" comment:"是否开启 1是 2 否" validate:"gt=0"`
	CreateIM IMCreateReqDto `json:"create_im" comment:"聊天室参数"`
	ChatType string         `json:"chat_type" comment:"im comment"`
	common.ControlBy
}

type UpdateLikesReq struct {
	Id       int    `json:"id" comment:""` //
	TenantId string `json:"tenant_id" comment:"租户id" validate:"required"`
	LiveId   int    `json:"live_id" comment:"直播间id" `
	IsEnable int    `json:"is_enable" comment:"是否开启 1是 2 否" validate:"gt=0"`
	common.ControlBy
}

type UpdateCountDownReq struct {
	Id       int    `json:"id" comment:""` //
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   int    `json:"live_id" comment:"直播间id" validate:"required"`
	IsEnable int    `json:"is_enable" comment:"是否开启 1是 2 否" validate:"gt=0"`
	common.ControlBy
}

type UpdateReservationReq struct {
	Id       int    `json:"id" comment:""` //
	TenantId string `json:"tenant_id" comment:"租户id" `
	LiveId   int    `json:"live_id" comment:"直播间id" validate:"required"`
	IsEnable int    `json:"is_enable" comment:"是否开启 1是 2 否" validate:"gt=0"`
	common.ControlBy
}

type GetLiveIds struct {
	TenantId string `json:"tenant_id" comment:"租户id"  validate:"required"`
}

type PullStreamLiveReq struct {
	//Id                int    `json:"id" comment:"直播流记录id"` //
	TenantId          string   `json:"tenant_id" comment:"租户id"`
	BasicId           int      `json:"basic_id" comment:"基本信息id" validate:"required"`
	PullStreamAddress []string `json:"pull_stream_address" comment:"拉流地址"`
	common.ControlBy
}

type StartPullStreamLiveReq struct {
	//Id                int    `json:"id" comment:"直播流记录id"` //
	TenantId string `json:"tenant_id" comment:"租户id"`
	BasicId  int    `json:"basic_id" comment:"基本信息id" validate:"required"`
	common.ControlBy
}
type StopPullStreamLiveReq struct {
	//Id                int    `json:"id" comment:"直播流记录id"` //
	TenantId string `json:"tenant_id" comment:"租户id"`
	BasicId  int    `json:"basic_id" comment:"基本信息id" validate:"required"`
	common.ControlBy
}

type UpdateCommentReq struct {
	Id       int    `json:"id" comment:""` //
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   int    `json:"live_id" comment:"直播间id" validate:"required"`
	IsEnable int    `json:"is_enable" comment:"是否开启 1是 2 否"`
	IsAudit  int    `json:"is_audit" comment:"是否审核 1是 2 否"`
	common.ControlBy
}

type GetPersonalReq struct {
	Id       int    `json:"id"`
	TenantId string `json:"tenant_id" comment:"租户id" validate:"required"`
}

type GetLiveStateReq struct {
	Id       int    `json:"id" comment:"" validate:"required"` //
	TenantId string `json:"tenant_id" comment:"租户id"`
}

type GetLiveStateRes struct {
	LiveState string `json:"live_state" comment:"直播间状态"`
	Round     string `json:"round" comment:"直播间场次"`
	LikesId   string `json:"likes_id" comment:"点赞id"`
	GroupId   string `json:"group_id" comment:"群组id"`
	DrawId    string `json:"draw_id" comment:"抽奖id"`
}

type SavePortal struct {
	Id            int    `json:"id" comment:""` //
	TenantId      string `json:"tenant_id" comment:"租户id"`
	PortalName    string `json:"portal_name" comment:"门户名称"`
	PortalDesc    string `json:"portal_desc" comment:"门户简介"`
	PortalLogo    string `json:"portal_logo" comment:"门户logo"`
	PortalFaceUrl string `json:"portal_face_url" comment:"门户封面"`
}

type GetPortal struct {
	TenantId string `json:"tenant_id" comment:"租户id" `
}

type GetPortalInfo struct {
	TenantId string `json:"tenant_id" comment:"租户id"`
}

type ConfirmRecord struct {
	Id        int `json:"basic_id"`
	IsConfirm int `json:"is_confirm" comment:"是否确认 1是 2否"`
}

type SavePublishSetting struct {
	Id           int    `json:"id" comment:""` //
	TenantId     string `json:"tenant_id" comment:"租户id"`
	LiveId       int    `json:"live_id" comment:"直播间id" validate:"required"`
	Introduction string `json:"introduction" comment:"简介"`
	Title        string `json:"title" comment:"标题"`
	LogoUrl      string `json:"logo_url" comment:"logo"`
}

type GetPublishSetting struct {
	Id       int    `json:"id"`
	TenantId string `json:"tenant_id" comment:"租户id"`
}

type StartPullLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id"`
	Type     string `json:"type"`
	Source   Source `json:"source"`
	LiveId   string `json:"live_id" comment:"直播间id" validate:"required"`
	PushUrl  string `json:"push_url" comment:"转推地址"`
}

type Source struct {
	Main   string `json:"main"`
	Backup string `json:"backup"`
}
type StopPullLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   string `json:"live_id" comment:"直播间id" validate:"required"`
	Id       string `json:"id" comment:"拉流任务id" validate:"required"`
}

type StartPushLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   string `json:"live_id" comment:"直播间id" validate:"required"`
	Id       string `json:"id" comment:"拉流任务id" validate:"required"`
}

type StopPushLiveReq struct {
	TenantId string `json:"tenant_id" comment:"租户id"`
	LiveId   string `json:"live_id" comment:"直播间id" validate:"required"`
	Id       string `json:"id" comment:"拉流任务id" validate:"required"`
}

type CreatePlatformReq struct {
	Id       int    `json:"id" comment:""`
	TenantId string `json:"tenant_id" comment:"租户id"`
	BasicId  int    `json:"basic_id" comment:"基本信息id" validate:"required"`
	Platform string `json:"platform" comment:"平台"`
	PushUrl  string `json:"push_url" comment:"转推地址"`
}

type UpdatePlatformReq struct {
	Id       int    `json:"id" comment:"d" validate:"required"`
	TenantId string `json:"tenant_id" comment:"租户id"`
	Platform string `json:"platform" comment:"平台"`
	PushUrl  string `json:"push_url" comment:"转推地址"`
}
type GetPlatformListReq struct {
	BasicId int `json:"basic_id" comment:"基本信息id" validate:"required"`
}

type GetPlatformReq struct {
	Id       int    `uri:"id"`
	TenantId string `json:"tenant_id" comment:"租户id"`
}

type DeletePlatformReq struct {
	Id int `json:"id" comment:""` //
}

type StartPlatformReq struct {
	Id int `json:"id" comment:""`
}

type StopPlatformReq struct {
	Id int `json:"id" comment:""`
}

type SetBlackUserReq struct {
	Id        int        `json:"id" comment:""` //
	GroupId   string     `json:"group_id" comment:"用户id"`
	LiveId    int        `json:"live_id" comment:"直播间id"`
	TenantId  string     `json:"tenant_id" comment:"租户"`
	UserInfos []UserInfo `json:"user_infos" comment:"用户"`
	MuteTime  int        `json:"mute_time" comment:"单位为秒，为0时表示取消禁言，4294967295为永久禁言。" validate:"gte=0"`
	BlackType int        `json:"black_type" comment:"用户状态 1禁言 2踢出 3黑屋"`
	UserState int        `json:"user_state" comment:"用户状态 1启用 2关闭"`
}

type UserInfo struct {
	UserId   string `json:"user_id" comment:"用户id"`
	UserName string `json:"user_name" comment:"用户名"`
	HeadUrl  string `json:"head_url" comment:"用户头像"`
}

type DeleteBlackUserReq struct {
	Id        int      `json:"id" comment:""` //
	LiveId    int      `json:"live_id" comment:"直播间id"`
	GroupId   string   `json:"group_id" comment:"群组id"`
	TenantId  string   `json:"tenant_id" comment:"租户"`
	UserIds   []string `json:"user_ids" comment:"用户id"`
	BlackType int      `json:"black_type" comment:"用户状态 1禁言 2踢出 3黑屋"`
}

type GetBlackUserReq struct {
	Id        int `json:"id" comment:""` //
	LiveId    int `json:"live_id" comment:"直播间id"`
	BlackType int `json:"black_type" comment:"用户状态 1禁言 2踢出 3黑屋"`
}

type StartPCLiveReq struct {
	LiveId int `json:"live_id" comment:"直播间id"`
}

type StartPCLiveRes struct {
	EvenId     string `json:"even_id" comment:"事件号"`
	HostUserId string `json:"host_user_id" comment:""`
}

type StopPCLiveReq struct {
	LiveId int `json:"live_id" comment:"直播间id"`
}

type CheckWhiteList struct {
}

type GetLiveDurationReq struct {
	TenantId  string `json:"tenant_id" comment:"租户"`
	StartTime int    `json:"start_time" comment:"开始时间"`
	EndTime   int    `json:"end_time" comment:"结束时间"`
}

type GetConNumReq struct {
	TenantId string `json:"tenant_id" comment:"租户"`
}
